import dayjs from "dayjs";

function getcolumns(setdrawer) {
  return {
    columns: [
      {
        title: "店铺名",
        dataIndex: "store_name",
        key: "store_name",
      },
      {
        title: "姓名",
        dataIndex: "user_name",
        key: "user_name",
        copyable:true,
        formItemProps: {
          rules: [
            {
              required: true,
              message: "此项为必填项",
            },
          ],
        },
      },
      {
        title: "电话",
        dataIndex: "telephone",
        key: "telephone",
        copyable:true,
        formItemProps: {
          rules: [
            {
              required: true,
              message: "此项为必填项",
            },
          ],
        },
      },
      {
        title: "地址",
        dataIndex: "address",
        key: "address",
        copyable:true,
        valueType: "textarea",
        colProps: {
          span: 24,
        },
      },
      {
        title: "型号",
        dataIndex: "model",
        key: "model",
      },
      {
        title: "数量",
        dataIndex: "num",
        key: "num",
        valueType: "digit",
        hideInSearch: true,
      },
      {
        title: "报单日期",
        dataIndex: "date",
        key: "date",
        valueType: "date",
        searchvalueType: "dateRange",
        formItemProps: {
          rules: [
            {
              required: true,
              message: "此项为必填项",
            },
          ],
        },
        render: (text, row) => {
          return dayjs(row?.date)?.format("YYYY-MM-DD");
        },
      },
      {
        title: "备注",
        dataIndex: "remark",
        key: "remark",
        valueType: "textarea",
        colProps: {
          span: 24,
        },
      },
    ],
    pathconfig: {
      enableadd: true,
      enableedit: true,
      enabledelete: true,
      enabledetail: true,
      add: "/webtool/v1/store",
      edit: "/webtool/v1/store",
      list: "/webtool/v1/store",
      delete: "/webtool/v1/store",
      detail: "",
    },
  };
}
export default getcolumns;
